package com.ai.platform.core.controller;
import com.ai.platform.model.dto.Output;
import com.ai.platform.core.context.InvocationContextHolder;
import com.ai.platform.core.service.IControlService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by yeyingsheng on 2018/4/3.
 */
public abstract class BaseController{

    @Autowired
    private IControlService controlService;

    private final static Logger logger = LoggerFactory.getLogger(BaseController.class);

    protected Output getOutput(){
        InvocationContextHolder context= InvocationContextHolder.getContext();
        return controlService.execute(context.getInput(),true);
    }

    protected IControlService getControlService(){
        return controlService;
    }

}
